Closed loop oxygen control